module.exports = {
  publicPath: './', // 基本路径
  assetsDir: "static",
  devServer: {
    port: "7777",
    proxy: {
      "/": {
        //代理api
        target: "http://192.168.1.131:680/", // 代理接口
        // target: "http://192.168.1.111:8200/", // 代理接口
        changeOrigin: true, //是否跨域
        pathRewrite: {
          //重写路径
          "": "", //代理路径
        },
      },
    },
  },
  css: {
    loaderOptions: {
      sass: {
        prependData: `
          @import "@/style/theme.scss";
        `,
      },
    },
  },
  // 解决css预处理语言伪元素样式乱码解决 使用css-unicode-loader
  configureWebpack: config => {
    config.module.rules.filter(rule => {
      return rule.test.toString().indexOf("scss") !== -1;
    })
    .forEach(rule => {
      rule.oneOf.forEach(oneOfRule => {
        oneOfRule.use.splice(oneOfRule.use.indexOf(require.resolve('sass-loader')), 0,
          { loader: require.resolve("css-unicode-loader") })
      })
    })
  }

};
